﻿package view.light
{
    import com.greensock.*;
    import flash.display.*;
    import flash.utils.*;

    public class LightFactory extends Object
    {
        public static var timelines:Dictionary = new Dictionary();

        public function LightFactory()
        {
            return;
        }// end function

        public static function showlight(param1:Sprite, param2:int = 10000) : void
        {
            var target:* = param1;
            var repeat:* = param2;
            if (timelines[target])
            {
                return;
            }
            if (repeat > 0)
            {
                timelines[target] = TweenMax.to(target, 1, {glowFilter:{color:16763904, alpha:1, blurX:13, blurY:13}, repeat:repeat, yoyo:true});
            }
            else
            {
                timelines[target] = TweenMax.to(target, 1, {glowFilter:{color:16763904, alpha:1, blurX:13, blurY:13}, yoyo:true, onComplete:function () : void
            {
                clearlight(target);
                return;
            }// end function
            });
            }
            return;
        }// end function

        public static function clearlight(param1:Sprite) : void
        {
            var _loc_2:* = timelines[param1];
            if (_loc_2)
            {
                _loc_2.kill();
                param1.filters = [];
                delete timelines[param1];
            }
            return;
        }// end function

    }
}
